home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-13 | 5.7 KB | 113 lines | [TEXT/CWIE] |
- /*
- File: AppleRGBPicker.h
- Copyright: © 1995-1996 by Apple Computer, Inc., all rights reserved.
- */
-
- //===============================================================================
- //
- // ScrapPicker.h
- //
- //===============================================================================
-
-
- #include <ColorPicker.h>
- #include <Palettes.h>
- #include "PickerCommon.h"
- #include "ScrapPickerConstants.h"
-
-
- typedef CMRGBColor CMPickerColor;
- typedef CMRGBColor CMUserColor;
-
-
- typedef struct PickerStorage
- {
- ComponentInstance myself; // This particular Component instance.
- GrafPtr port; // The dialog/port picker is in.
- long flags; // Copy of flags passed in.
-
- PMColor currPMColor; // The current color as selected by the user.
- PMColor origPMColor; // The original color passed in to the picker.
- PMColor wasColor; // Used for Undo.
- PixPatHandle newColorPat; // * Pattern (RGB dither pat) used to display the new color.
- PixPatHandle origColorPat; // * Pattern (RGB dither pat) used to display the original color.
- Str255 prompt; // Prompt string passed in (we ignore it).
-
- ColorChangedUPP colorProc; // The application's color changed procedure.
- long colorProcData; // The application's color changed data
- SInt16 baseItem; // The index of our first dialog item.
- SInt16 pictNumber; // Pict currently being viewed.
- SInt16 numPicts; // Number of PICTs in the Scrapbook File.
- SInt16 depth; // Pixel depth of device we're initially on.
- Boolean visible; // Are we visible yet?
- Boolean realPicker; // True if we passed initialization.
- Boolean active; // Are we active?
- Boolean useColorPats; // Patterns are pixpats instead of old-style patterns.
- Boolean calledNPickColor; // Were we called via the new NPickColor?
- } PickerStorage, *PickerStoragePtr, **PickerStorageHandle;
-
- // * Requires explicit disposal.
-
- //===================================================================== Prototypes
-
- // ScrapPickerEntry.c
- pascal ComponentResult main (ComponentParameters *params, Handle storage);
-
- // ScrapPicker.c
- pascal ComponentResult doPickerOpen (PickerStorageHandle, ComponentInstance);
- pascal ComponentResult doPickerClose (PickerStorageHandle, ComponentInstance);
- pascal ComponentResult doPickerCanDo (PickerStorageHandle, short);
- pascal ComponentResult doPickerVersion (PickerStorageHandle);
- pascal ComponentResult doPickerRegister (PickerStorageHandle);
- pascal ComponentResult doPickerSetTarget (PickerStorageHandle, ComponentInstance);
- pascal ComponentResult doPickerInit (PickerStorageHandle, PickerInitData *);
- pascal ComponentResult doPickerGetDialog (PickerStorageHandle);
- pascal ComponentResult doPickerTestGraphicsWorld (PickerStorageHandle, PickerInitData *);
- pascal ComponentResult doPickerGetAttributes (PickerStorageHandle);
- pascal ComponentResult doPickerGetColor (PickerStorageHandle, ColorType, PMColorPtr);
- pascal ComponentResult doPickerSetColor (PickerStorageHandle, ColorType, PMColorPtr);
- pascal ComponentResult doPickerEvent (PickerStorageHandle, EventData *);
- pascal ComponentResult doPickerEdit (PickerStorageHandle, EditData *);
- pascal ComponentResult doPickerSetVisibility (PickerStorageHandle, Boolean);
- pascal ComponentResult doPickerDisplay (PickerStorageHandle);
- pascal ComponentResult doPickerItemHit (PickerStorageHandle, ItemHitData *);
- pascal ComponentResult doPickerGetItemList (PickerStorageHandle);
- pascal ComponentResult doPickerSetBaseItem (PickerStorageHandle, short);
- pascal ComponentResult doPickerGetProfile (PickerStorageHandle);
- pascal ComponentResult doPickerSetProfile (PickerStorageHandle, CMProfileHandle);
- pascal ComponentResult doPickerGetPrompt (PickerStorageHandle, Str255);
- pascal ComponentResult doPickerSetPrompt (PickerStorageHandle, Str255);
- pascal ComponentResult doPickerGetIconData (PickerStorageHandle, PickerIconData *);
- pascal ComponentResult doPickerGetEditMenuState (PickerStorageHandle, PickerMenuState *);
- pascal ComponentResult doPickerSetOrigin (PickerStorageHandle, Point);
- pascal ComponentResult doPickerExtractHelpItem (PickerStorageHandle, short, short, HelpItemInfo *);
- pascal ComponentResult doPickerSetColorChangedProc (PickerStorageHandle, ColorChangedUPP colorProc, long colorProcData);
- #if NEW_COLORPICKER_2_1_CALLS
- pascal ComponentResult doNPickerGetColor (PickerStorageHandle, ColorType, NPMColorPtr);
- pascal ComponentResult doNPickerSetColor (PickerStorageHandle, ColorType, NPMColorPtr);
- pascal ComponentResult doNPickerGetProfile (PickerStorageHandle, CMProfileRef *);
- pascal ComponentResult doNPickerSetProfile (PickerStorageHandle, CMProfileRef);
- pascal ComponentResult doNPickerSetColorChangedProc (PickerStorageHandle, NColorChangedUPP colorProc, long colorProcData);
- #endif // NEW_COLORPICKER_2_1_CALLS
-
- // ScrapPickerDraw.c
- void DrawColorEditor (PickerStorageHandle, UInt32);
- SInt16 OpenScrapBookFile (void);
-
- // ScrapPickerUtils.c
- void ActivatePicker (PickerStorageHandle);
- void DeactivatePicker (PickerStorageHandle);
- OSErr DoMouseDown (PickerStorageHandle, EventData *);
- OSErr DoKeyDown (PickerStorageHandle, EventData *);
- OSErr DoKeyUp (PickerStorageHandle, EventData *);
- OSErr DoIdle (PickerStorageHandle, EventData *);
- void CheckCurrentWorld (PickerStorageHandle, short, ItemHitData *);
- void CheckAllNumbers (PickerStorageHandle, EventData *);
- OSErr DoListClick (PickerStorageHandle, ItemHitData *);
- Boolean PtInItem (PickerStorageHandle, Point, short);
- void GetItemRect (PickerStorageHandle, short, Rect *);
- Handle GetItemHandle (PickerStorageHandle, short);
- void SetColorPattern (PickerStorageHandle, ColorType);
- void SelectDeselectItemText (PickerStorageHandle, SInt16, Boolean);
-
-